Nightly Per-Antenna Quality Summary Notebook¶

Josh Dillon, Last Revised February 2021

This notebooks brings together as much information as possible from ant_metrics, auto_metrics and redcal to help figure out which antennas are working properly and summarizes it in a single giant table. It is meant to be lightweight and re-run as often as necessary over the night, so it can be run when any of those is done and then be updated when another one completes.

Contents:¶

  • Table 1: Overall Array Health
  • Table 2: RTP Per-Antenna Metrics Summary Table
  • Figure 1: Array Plot of Flags and A Priori Statuses
In [1]:
import os
os.environ['HDF5_USE_FILE_LOCKING'] = 'FALSE'
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
import pandas as pd
pd.set_option('display.max_rows', 1000)
from hera_qm.metrics_io import load_metric_file
from hera_cal import utils, io, redcal
import glob
import h5py
from copy import deepcopy
from IPython.display import display, HTML
from hera_notebook_templates.utils import status_colors
from hera_mc import mc
from pyuvdata import UVData

%matplotlib inline
%config InlineBackend.figure_format = 'retina'
display(HTML("<style>.container { width:100% !important; }</style>"))
In [2]:
# If you want to run this notebook locally, copy the output of the next cell into the first few lines of this cell.

# JD = "2459122"
# data_path = '/lustre/aoc/projects/hera/H4C/2459122'
# ant_metrics_ext = ".ant_metrics.hdf5"
# redcal_ext = ".maybe_good.omni.calfits"
# nb_outdir = '/lustre/aoc/projects/hera/H4C/h4c_software/H4C_Notebooks/_rtp_summary_'
# good_statuses = "digital_ok,calibration_maintenance,calibration_triage,calibration_ok"
# os.environ["JULIANDATE"] = JD
# os.environ["DATA_PATH"] = data_path
# os.environ["ANT_METRICS_EXT"] = ant_metrics_ext
# os.environ["REDCAL_EXT"] = redcal_ext
# os.environ["NB_OUTDIR"] = nb_outdir
# os.environ["GOOD_STATUSES"] = good_statuses
In [3]:
# Use environment variables to figure out path to data
JD = os.environ['JULIANDATE']
data_path = os.environ['DATA_PATH']
ant_metrics_ext = os.environ['ANT_METRICS_EXT']
redcal_ext = os.environ['REDCAL_EXT']
nb_outdir = os.environ['NB_OUTDIR']
good_statuses = os.environ['GOOD_STATUSES']
print(f'JD = "{JD}"')
print(f'data_path = "{data_path}"')
print(f'ant_metrics_ext = "{ant_metrics_ext}"')
print(f'redcal_ext = "{redcal_ext}"')
print(f'nb_outdir = "{nb_outdir}"')
print(f'good_statuses = "{good_statuses}"')
JD = "2459833"
data_path = "/mnt/sn1/2459833"
ant_metrics_ext = ".ant_metrics.hdf5"
redcal_ext = ".known_good.omni.calfits"
nb_outdir = "/home/obs/src/H6C_Notebooks/_rtp_summary_"
good_statuses = "digital_ok,calibration_maintenance,calibration_triage,calibration_ok"
In [4]:
from astropy.time import Time
utc = Time(JD, format='jd').datetime
print(f'Date: {utc.month}-{utc.day}-{utc.year}')
Date: 9-10-2022
In [5]:
# Per-season options
def ant_to_report_url(ant):
    return f'https://htmlpreview.github.io/?https://github.com/HERA-Team/H6C_Notebooks/blob/main/antenna_report/antenna_{ant}_report.html'

Load Auto Metrics¶

In [6]:
use_auto_metrics = False

# find the auto_metrics file
glob_str = os.path.join(data_path, f'zen.{JD}*.auto_metrics.h5')
auto_metrics_file = sorted(glob.glob(glob_str))

# if it exists, load and extract relevant information
if len(auto_metrics_file) > 0:
    auto_metrics_file = auto_metrics_file[0]
    print(f'Found auto_metrics results file at {auto_metrics_file}.')
    
    auto_metrics = load_metric_file(auto_metrics_file)
    mean_round_modz_cut = auto_metrics['parameters']['mean_round_modz_cut']
    auto_ex_ants = auto_metrics['ex_ants']['r2_ex_ants']
    
    use_auto_metrics = True
else:
    print(f'No files found matching glob {glob_str}. Skipping auto_metrics.')
Found auto_metrics results file at /mnt/sn1/2459833/zen.2459833.25312.sum.auto_metrics.h5.

Load Ant Metrics¶

In [7]:
use_ant_metrics = False

# get a list of all ant_metrics files
glob_str = os.path.join(data_path, f'zen.{JD}.?????.sum{ant_metrics_ext}')
ant_metrics_files = sorted(glob.glob(glob_str))

# if they exist, load as many of them as possible
if len(ant_metrics_files) > 0:
    print(f'Found {len(ant_metrics_files)} ant_metrics files matching glob {glob_str}')
    ant_metrics_apriori_exants = {}
    ant_metrics_xants_dict = {}
    ant_metrics_dead_ants_dict = {}
    ant_metrics_crossed_ants_dict = {}
    ant_metrics_dead_metrics = {}
    ant_metrics_crossed_metrics = {}
    dead_cuts = {}
    crossed_cuts = {}
    for amf in ant_metrics_files:
        with h5py.File(amf, "r") as infile: # use h5py directly since it's much faster than load_metric_file
            # get out results for this file
            dead_cuts[amf] = infile['Metrics']['dead_ant_cut'][()]
            crossed_cuts[amf] = infile['Metrics']['cross_pol_cut'][()]
            xants = infile['Metrics']['xants'][:]
            dead_ants = infile['Metrics']['dead_ants'][:]
            crossed_ants = infile['Metrics']['crossed_ants'][:]        
            try:
                # look for ex_ants in history
                ex_ants_string = infile['Header']['history'][()].decode()
                ex_ants_string = ex_ants_string.split('--apriori_xants')[1]
                ex_ants_string = ex_ants_string.split('--')[0].strip()
            except:
                ex_ants_string = ''
                    
            # This only works for the new correlation-matrix-based ant_metrics
            if 'corr' in infile['Metrics']['final_metrics'] and 'corrXPol' in infile['Metrics']['final_metrics']:
                ant_metrics_dead_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corr'][ant][()]
                                                 for ant in infile['Metrics']['final_metrics']['corr']}
                ant_metrics_crossed_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corrXPol'][ant][()]
                                                    for ant in infile['Metrics']['final_metrics']['corrXPol']}                       
            else:
                raise(KeywordError)
        
        # organize results by file
        ant_metrics_xants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in xants]
        ant_metrics_dead_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in dead_ants]
        ant_metrics_crossed_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in crossed_ants]
        ant_metrics_apriori_exants[amf] = [int(ant) for ant in ex_ants_string.split()]
    
    dead_cut = np.median(list(dead_cuts.values()))
    crossed_cut = np.median(list(crossed_cuts.values()))
        
    use_ant_metrics = True
else:
    print(f'No files found matching glob {glob_str}. Skipping ant_metrics.')
Found 342 ant_metrics files matching glob /mnt/sn1/2459833/zen.2459833.?????.sum.ant_metrics.hdf5

Load chi^2 info from redcal¶

In [8]:
use_redcal = False
glob_str = os.path.join(data_path, f'zen.{JD}.?????.sum{redcal_ext}')

redcal_files = sorted(glob.glob(glob_str))
if len(redcal_files) > 0:
    print(f'Found {len(redcal_files)} ant_metrics files matching glob {glob_str}')
    post_redcal_ant_flags_dict = {}
    flagged_by_redcal_dict = {}
    cspa_med_dict = {}
    for cal in redcal_files:
        hc = io.HERACal(cal)
        _, flags, cspa, chisq = hc.read()
        cspa_med_dict[cal] = {ant: np.nanmedian(cspa[ant], axis=1) for ant in cspa}

        post_redcal_ant_flags_dict[cal] = {ant: np.all(flags[ant]) for ant in flags}
        # check history to distinguish antennas flagged going into redcal from ones flagged during redcal
        tossed_antenna_lines =  hc.history.replace('\n','').split('Throwing out antenna ')[1:]
        flagged_by_redcal_dict[cal] = sorted([int(line.split(' ')[0]) for line in tossed_antenna_lines])
        
    use_redcal = True
else:
    print(f'No files found matching glob {glob_str}. Skipping redcal chisq.')
No files found matching glob /mnt/sn1/2459833/zen.2459833.?????.sum.known_good.omni.calfits. Skipping redcal chisq.

Figure out some general properties¶

In [9]:
# Parse some general array properties, taking into account the fact that we might be missing some of the metrics
ants = []
pols = []
antpol_pairs = []

if use_auto_metrics:
    ants = sorted(set(bl[0] for bl in auto_metrics['modzs']['r2_shape_modzs']))
    pols = sorted(set(bl[2] for bl in auto_metrics['modzs']['r2_shape_modzs']))
if use_ant_metrics:
    antpol_pairs = sorted(set([antpol for dms in ant_metrics_dead_metrics.values() for antpol in dms.keys()]))
    antpols = sorted(set(antpol[1] for antpol in antpol_pairs))
    ants = sorted(set(antpol[0] for antpol in antpol_pairs) | set(ants))
    pols = sorted(set(utils.join_pol(ap, ap) for ap in antpols) | set(pols))
if use_redcal:
    antpol_pairs = sorted(set([ant for cspa in cspa_med_dict.values() for ant in cspa.keys()]) | set(antpol_pairs))
    antpols = sorted(set(antpol[1] for antpol in antpol_pairs))
    ants = sorted(set(antpol[0] for antpol in antpol_pairs) | set(ants))
    pols = sorted(set(utils.join_pol(ap, ap) for ap in antpols) | set(pols))

# Figure out remaining antennas not in data and also LST range
data_files = sorted(glob.glob(os.path.join(data_path, 'zen.*.sum.uvh5')))
hd = io.HERAData(data_files[0])
unused_ants = [ant for ant in hd.antpos if ant not in ants]    
hd_last = io.HERAData(data_files[-1])

Load a priori antenna statuses and node numbers¶

In [10]:
# try to load a priori antenna statusesm but fail gracefully if this doesn't work.
a_priori_statuses = {ant: 'Not Found' for ant in ants}
nodes = {ant: np.nan for ant in ants + unused_ants}
try:
    from hera_mc import cm_hookup

    # get node numbers
    hookup = cm_hookup.get_hookup('default')
    for ant_name in hookup:
        ant = int("".join(filter(str.isdigit, ant_name)))
        if ant in nodes:
            if hookup[ant_name].get_part_from_type('node')['E<ground'] is not None:
                nodes[ant] = int(hookup[ant_name].get_part_from_type('node')['E<ground'][1:])
    
    # get apriori antenna status
    for ant_name, data in hookup.items():
        ant = int("".join(filter(str.isdigit, ant_name)))
        if ant in a_priori_statuses:
            a_priori_statuses[ant] = data.apriori

except Exception as err:
    print(f'Could not load node numbers and a priori antenna statuses.\nEncountered {type(err)} with message: {err}')

Summarize auto metrics¶

In [11]:
if use_auto_metrics:
    # Parse modzs
    modzs_to_check = {'Shape': 'r2_shape_modzs', 'Power': 'r2_power_modzs', 
                      'Temporal Variability': 'r2_temp_var_modzs', 'Temporal Discontinuties': 'r2_temp_diff_modzs'}
    worst_metrics = []
    worst_zs = []
    all_modzs = {}
    binary_flags = {rationale: [] for rationale in modzs_to_check}

    for ant in ants:
        # parse modzs and figure out flag counts
        modzs = {f'{pol} {rationale}': auto_metrics['modzs'][dict_name][(ant, ant, pol)] 
                 for rationale, dict_name in modzs_to_check.items() for pol in pols}
        for pol in pols:
            for rationale, dict_name in modzs_to_check.items():
                binary_flags[rationale].append(auto_metrics['modzs'][dict_name][(ant, ant, pol)] > mean_round_modz_cut)

        # parse out all metrics for dataframe
        for k in modzs:
            col_label = k + ' Modified Z-Score'
            if col_label in all_modzs:
                all_modzs[col_label].append(modzs[k])
            else:
                all_modzs[col_label] = [modzs[k]]
                
    mean_round_modz_cut = auto_metrics['parameters']['mean_round_modz_cut']
else:
    mean_round_modz_cut = 0

Summarize ant metrics¶

In [12]:
if use_ant_metrics:
    a_priori_flag_frac = {ant: np.mean([ant in apxa for apxa in ant_metrics_apriori_exants.values()]) for ant in ants}
    dead_ant_frac = {ap: {ant: np.mean([(ant, ap) in das for das in ant_metrics_dead_ants_dict.values()])
                                 for ant in ants} for ap in antpols}
    crossed_ant_frac = {ant: np.mean([np.any([(ant, ap) in cas for ap in antpols])
                                      for cas in ant_metrics_crossed_ants_dict.values()]) for ant in ants}
    ant_metrics_xants_frac_by_antpol = {antpol: np.mean([antpol in amx for amx in ant_metrics_xants_dict.values()]) for antpol in antpol_pairs}
    ant_metrics_xants_frac_by_ant = {ant: np.mean([np.any([(ant, ap) in amx for ap in antpols])
                                     for amx in ant_metrics_xants_dict.values()]) for ant in ants}
    average_dead_metrics = {ap: {ant: np.nanmean([dm.get((ant, ap), np.nan) for dm in ant_metrics_dead_metrics.values()]) 
                                 for ant in ants} for ap in antpols}
    average_crossed_metrics = {ant: np.nanmean([cm.get((ant, ap), np.nan) for ap in antpols 
                                                for cm in ant_metrics_crossed_metrics.values()]) for ant in ants}
else:
    dead_cut = 0.4
    crossed_cut = 0.0

Summarize redcal chi^2 metrics¶

In [13]:
if use_redcal:
    cspa = {ant: np.nanmedian(np.hstack([cspa_med_dict[cal][ant] for cal in redcal_files])) for ant in antpol_pairs}
    redcal_prior_flag_frac = {ant: np.mean([np.any([afd[ant, ap] and not ant in flagged_by_redcal_dict[cal] for ap in antpols])
                                            for cal, afd in post_redcal_ant_flags_dict.items()]) for ant in ants}
    redcal_flagged_frac = {ant: np.mean([ant in fbr for fbr in flagged_by_redcal_dict.values()]) for ant in ants}

Get FEM switch states¶

In [14]:
HHautos = sorted(glob.glob(f"{data_path}/zen.{JD}.*.sum.autos.uvh5"))
diffautos = sorted(glob.glob(f"{data_path}/zen.{JD}.*.diff.autos.uvh5"))

try:
    db = mc.connect_to_mc_db(None)
    session = db.sessionmaker()
    startJD = float(HHautos[0].split('zen.')[1].split('.sum')[0])
    stopJD = float(HHautos[-1].split('zen.')[1].split('.sum')[0])
    startTime = Time(startJD,format='jd')
    stopTime = Time(stopJD,format='jd')
    res = session.get_antenna_status(starttime=startTime, stoptime=stopTime)
    fem_switches = {}
    if len(res) == 0:
        femState = None
    else:
        for antpol in res:
            fem_switches[(antpol.antenna_number, antpol.antenna_feed_pol)] = antpol.fem_switch
    femState = (max(set(list(fem_switches.values())), key = list(fem_switches.values()).count)) 
except Exception as e:
    print(e)
    femState = None

Find X-engine Failures¶

In [15]:
read_inds = [1, len(HHautos)//2, -2]
x_status = [1,1,1,1,1,1,1,1]
s = UVData()
s.read(HHautos[1])

nants = len(s.get_ants())
freqs = s.freq_array[0]*1e-6
nfreqs = len(freqs)

antCon = {a: None for a in ants}
rightAnts = []
for i in read_inds:
    s = UVData()
    d = UVData()
    s.read(HHautos[i])
    d.read(diffautos[i])
    for pol in [0,1]:
        sm = np.abs(s.data_array[:,0,:,pol])
        df = np.abs(d.data_array[:,0,:,pol])
        sm = np.r_[sm, np.nan + np.zeros((-len(sm) % nants,len(freqs)))]
        sm = np.nanmean(sm.reshape(-1,nants,nfreqs),axis=1)
        df = np.r_[df, np.nan + np.zeros((-len(df) % nants,len(freqs)))]
        df = np.nanmean(df.reshape(-1,nants,nfreqs),axis=1)

        evens = (sm + df)/2
        odds = (sm - df)/2
        rat = np.divide(evens,odds)
        rat = np.nan_to_num(rat)
        for xbox in range(0,8):
            xavg = np.nanmean(rat[:,xbox*192:(xbox+1)*192],axis=1)
            if np.nanmax(xavg)>1.5 or np.nanmin(xavg)<0.5:
                x_status[xbox] = 0
    for ant in ants:
        for pol in ["xx", "yy"]:
            if antCon[ant] is False:
                continue
            spectrum = s.get_data(ant, ant, pol)
            stdev = np.std(spectrum)
            med = np.median(np.abs(spectrum))
            if (femState == "load" or femState == 'noise') and 80000 < stdev <= 4000000 and antCon[ant] is not False:
                antCon[ant] = True
            elif femState == "antenna" and stdev > 500000 and med > 950000 and antCon[ant] is not False:
                antCon[ant] = True
            else:
                antCon[ant] = False
            if np.min(np.abs(spectrum)) < 100000:
                antCon[ant] = False
for ant in ants:
    if antCon[ant] is True:
        rightAnts.append(ant)
            
x_status_str = ''
for i,x in enumerate(x_status):
    if x==0:
        x_status_str += '\u274C '
    else:
        x_status_str += '\u2705 '

Build Overall Health DataFrame¶

In [16]:
def comma_sep_paragraph(vals, chars_per_line=40):
    outstrs = []
    for val in vals:
        if (len(outstrs) == 0) or (len(outstrs[-1]) > chars_per_line):
            outstrs.append(str(val))
        else:
            outstrs[-1] += ', ' + str(val)
    return ',<br>'.join(outstrs)
In [17]:
# Time data
to_show = {'JD': [JD]}
to_show['Date'] = f'{utc.month}-{utc.day}-{utc.year}'
to_show['LST Range'] = f'{hd.lsts[0] * 12 / np.pi:.3f} -- {hd_last.lsts[-1] * 12 / np.pi:.3f} hours'

# X-engine status
to_show['X-Engine Status'] = x_status_str

# Files
to_show['Number of Files'] = len(data_files)

# Antenna Calculations
to_show['Total Number of Antennas'] = len(ants)

to_show[' '] = ''
to_show['OPERATIONAL STATUS SUMMARY'] = ''

status_count = {status: 0 for status in status_colors}
for ant, status in a_priori_statuses.items():
    if status in status_count:
        status_count[status] = status_count[status] + 1
    else:
        status_count[status] = 1
to_show['Antenna A Priori Status Count'] = '<br>'.join([f'{status}: {status_count[status]}' for status in status_colors if status in status_count and status_count[status] > 0])

to_show['Commanded Signal Source'] = femState
to_show['Antennas in Commanded State'] = f'{len(rightAnts)} / {len(ants)} ({len(rightAnts) / len(ants):.1%})'

if use_ant_metrics:
    to_show['Cross-Polarized Antennas'] = ', '.join([str(ant) for ant in ants if (np.max([dead_ant_frac[ap][ant] for ap in antpols]) + crossed_ant_frac[ant] == 1) 
                                                                                 and (crossed_ant_frac[ant] > .5)])

# Node calculations
nodes_used = set([nodes[ant] for ant in ants if np.isfinite(nodes[ant])])
to_show['Total Number of Nodes'] = len(nodes_used)
if use_ant_metrics:
    node_off = {node: True for node in nodes_used}
    not_correlating = {node: True for node in nodes_used}
    for ant in ants:
        for ap in antpols:
            if np.isfinite(nodes[ant]):
                if np.isfinite(average_dead_metrics[ap][ant]):
                    node_off[nodes[ant]] = False
                if dead_ant_frac[ap][ant] < 1:
                    not_correlating[nodes[ant]] = False
    to_show['Nodes Registering 0s'] = ', '.join([f'N{n:02}' for n in sorted([node for node in node_off if node_off[node]])])
    to_show['Nodes Not Correlating'] = ', '.join([f'N{n:02}' for n in sorted([node for node in not_correlating if not_correlating[node] and not node_off[node]])])

# Pipeline calculations    
to_show['  '] = ''
to_show['NIGHTLY ANALYSIS SUMMARY'] = ''
    
all_flagged_ants = []
if use_ant_metrics:
    to_show['Ant Metrics Done?'] = '\u2705'
    ant_metrics_flagged_ants = [ant for ant in ants if ant_metrics_xants_frac_by_ant[ant] > 0]
    all_flagged_ants.extend(ant_metrics_flagged_ants)
    to_show['Ant Metrics Flagged Antennas'] = f'{len(ant_metrics_flagged_ants)} / {len(ants)} ({len(ant_metrics_flagged_ants) / len(ants):.1%})' 
else:
    to_show['Ant Metrics Done?'] = '\u274C'
if use_auto_metrics:
    to_show['Auto Metrics Done?'] = '\u2705'
    auto_metrics_flagged_ants = [ant for ant in ants if ant in auto_ex_ants]
    all_flagged_ants.extend(auto_metrics_flagged_ants)    
    to_show['Auto Metrics Flagged Antennas'] = f'{len(auto_metrics_flagged_ants)} / {len(ants)} ({len(auto_metrics_flagged_ants) / len(ants):.1%})' 
else:
    to_show['Auto Metrics Done?'] = '\u274C'
if use_redcal:
    to_show['Redcal Done?'] = '\u2705'    
    redcal_flagged_ants = [ant for ant in ants if redcal_flagged_frac[ant] > 0]
    all_flagged_ants.extend(redcal_flagged_ants)    
    to_show['Redcal Flagged Antennas'] = f'{len(redcal_flagged_ants)} / {len(ants)} ({len(redcal_flagged_ants) / len(ants):.1%})' 
else:
    to_show['Redcal Done?'] = '\u274C' 
to_show['Never Flagged Antennas'] = f'{len(ants) - len(set(all_flagged_ants))} / {len(ants)} ({(len(ants) - len(set(all_flagged_ants))) / len(ants):.1%})'

# Count bad antennas with good statuses and vice versa
n_apriori_good = len([ant for ant in ants if a_priori_statuses[ant] in good_statuses.split(',')])
apriori_good_flagged = []
aprior_bad_unflagged = []
for ant in ants:
    if ant in set(all_flagged_ants) and a_priori_statuses[ant] in good_statuses.split(','):
        apriori_good_flagged.append(ant)
    elif ant not in set(all_flagged_ants) and a_priori_statuses[ant] not in good_statuses.split(','):
        aprior_bad_unflagged.append(ant)
to_show['A Priori Good Antennas Flagged'] = f'{len(apriori_good_flagged)} / {n_apriori_good} total a priori good antennas:<br>' + \
                                            comma_sep_paragraph(apriori_good_flagged)
to_show['A Priori Bad Antennas Not Flagged'] = f'{len(aprior_bad_unflagged)} / {len(ants) - n_apriori_good} total a priori bad antennas:<br>' + \
                                            comma_sep_paragraph(aprior_bad_unflagged)

# Apply Styling
df = pd.DataFrame(to_show)
divider_cols = [df.columns.get_loc(col) for col in ['NIGHTLY ANALYSIS SUMMARY', 'OPERATIONAL STATUS SUMMARY']]
try:
    to_red_columns = [df.columns.get_loc(col) for col in ['Cross-Polarized Antennas', 'Nodes Registering 0s', 
                                                          'Nodes Not Correlating', 'A Priori Good Antennas Flagged']]
except:
    to_red_columns = []
def red_specific_cells(x):
    df1 = pd.DataFrame('', index=x.index, columns=x.columns)
    for col in to_red_columns:
        df1.iloc[col] = 'color: red'
    return df1

df = df.T
table = df.style.hide_columns().apply(red_specific_cells, axis=None)
for col in divider_cols:
    table = table.set_table_styles([{"selector":f"tr:nth-child({col+1})", "props": [("background-color", "black"), ("color", "white")]}], overwrite=False)

Table 1: Overall Array Health¶

In [18]:
HTML(table.render())
Out[18]:
JD 2459833
Date 9-10-2022
LST Range 18.819 -- 20.819 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 372
Total Number of Antennas 139
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 3
RF_maintenance: 32
RF_ok: 3
digital_maintenance: 3
digital_ok: 95
not_connected: 3
Commanded Signal Source None
Antennas in Commanded State 0 / 139 (0.0%)
Cross-Polarized Antennas
Total Number of Nodes 14
Nodes Registering 0s N18
Nodes Not Correlating N01, N03, N05, N08, N09, N12
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 128 / 139 (92.1%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 94 / 139 (67.6%)
Redcal Done? ❌
Never Flagged Antennas 0 / 139 (0.0%)
A Priori Good Antennas Flagged 95 / 95 total a priori good antennas:
3, 5, 7, 9, 10, 15, 16, 17, 19, 20, 21, 29,
30, 31, 37, 38, 40, 41, 42, 45, 46, 51, 53,
54, 55, 56, 65, 66, 67, 68, 69, 71, 72, 73,
81, 83, 84, 85, 86, 88, 91, 93, 94, 98, 99,
100, 101, 103, 105, 106, 107, 108, 109, 111,
112, 116, 117, 118, 121, 122, 123, 127, 128,
129, 130, 140, 141, 142, 143, 144, 156, 157,
158, 160, 161, 162, 163, 164, 165, 167, 169,
170, 176, 177, 178, 179, 181, 183, 184, 185,
186, 187, 189, 190, 191
A Priori Bad Antennas Not Flagged 0 / 44 total a priori bad antennas:
In [19]:
# write to csv
outpath = os.path.join(nb_outdir, f'array_health_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.replace({'\u2705': 'Y'}, regex=True).replace({'\u274C': 'N'}, regex=True).replace({'<br>': ' '}, regex=True).to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/array_health_table_2459833.csv

Build DataFrame¶

In [20]:
# build dataframe
to_show = {'Ant': [f'<a href="{ant_to_report_url(ant)}" target="_blank">{ant}</a>' for ant in ants],
           'Node': [f'N{nodes[ant]:02}' for ant in ants], 
           'A Priori Status': [a_priori_statuses[ant] for ant in ants]}
           #'Worst Metric': worst_metrics, 'Worst Modified Z-Score': worst_zs}
df = pd.DataFrame(to_show)

# create bar chart columns for flagging percentages:
bar_cols = {}
if use_auto_metrics:
    bar_cols['Auto Metrics Flags'] = [float(ant in auto_ex_ants) for ant in ants]
if use_ant_metrics:
    if np.sum(list(a_priori_flag_frac.values())) > 0:  # only include this col if there are any a priori flags
        bar_cols['A Priori Flag Fraction in Ant Metrics'] = [a_priori_flag_frac[ant] for ant in ants]
    for ap in antpols:
        bar_cols[f'Dead Fraction in Ant Metrics ({ap})'] = [dead_ant_frac[ap][ant] for ant in ants]
    bar_cols['Crossed Fraction in Ant Metrics'] = [crossed_ant_frac[ant] for ant in ants]
if use_redcal:
    bar_cols['Flag Fraction Before Redcal'] = [redcal_prior_flag_frac[ant] for ant in ants]
    bar_cols['Flagged By Redcal chi^2 Fraction'] = [redcal_flagged_frac[ant] for ant in ants]  
for col in bar_cols:
    df[col] = bar_cols[col]

# add auto_metrics
if use_auto_metrics:
    for label, modz in all_modzs.items():
        df[label] = modz
z_score_cols = [col for col in df.columns if 'Modified Z-Score' in col]        
        
# add ant_metrics
ant_metrics_cols = {}
if use_ant_metrics:
    for ap in antpols:
        ant_metrics_cols[f'Average Dead Ant Metric ({ap})'] = [average_dead_metrics[ap][ant] for ant in ants]
    ant_metrics_cols['Average Crossed Ant Metric'] = [average_crossed_metrics[ant] for ant in ants]
    for col in ant_metrics_cols:
        df[col] = ant_metrics_cols[col]   

# add redcal chisq
redcal_cols = []
if use_redcal:
    for ap in antpols:
        col_title = f'Median chi^2 Per Antenna ({ap})'
        df[col_title] = [cspa[ant, ap] for ant in ants]
        redcal_cols.append(col_title)

# sort by node number and then by antenna number within nodes
df.sort_values(['Node', 'Ant'], ascending=True)

# style dataframe
table = df.style.hide_index()\
          .applymap(lambda val: f'background-color: {status_colors[val]}' if val in status_colors else '', subset=['A Priori Status']) \
          .background_gradient(cmap='viridis', vmax=mean_round_modz_cut * 3, vmin=0, axis=None, subset=z_score_cols) \
          .background_gradient(cmap='bwr_r', vmin=dead_cut-.25, vmax=dead_cut+.25, axis=0, subset=list([col for col in ant_metrics_cols if 'dead' in col.lower()])) \
          .background_gradient(cmap='bwr_r', vmin=crossed_cut-.25, vmax=crossed_cut+.25, axis=0, subset=list([col for col in ant_metrics_cols if 'crossed' in col.lower()])) \
          .background_gradient(cmap='plasma', vmax=4, vmin=1, axis=None, subset=redcal_cols) \
          .applymap(lambda val: 'font-weight: bold' if val < dead_cut else '', subset=list([col for col in ant_metrics_cols if 'dead' in col.lower()])) \
          .applymap(lambda val: 'font-weight: bold' if val < crossed_cut else '', subset=list([col for col in ant_metrics_cols if 'crossed' in col.lower()])) \
          .applymap(lambda val: 'font-weight: bold' if val > mean_round_modz_cut else '', subset=z_score_cols) \
          .applymap(lambda val: 'color: red' if val > mean_round_modz_cut else '', subset=z_score_cols) \
          .bar(subset=list(bar_cols.keys()), vmin=0, vmax=1) \
          .format({col: '{:,.4f}'.format for col in z_score_cols}) \
          .format({col: '{:,.4f}'.format for col in ant_metrics_cols}) \
          .format({col: '{:,.2%}'.format for col in bar_cols}) \
          .applymap(lambda val: 'font-weight: bold', subset=['Ant']) \
          .set_table_styles([dict(selector="th",props=[('max-width', f'70pt')])])

Table 2: RTP Per-Antenna Metrics Summary Table¶

This admittedly very busy table incorporates summary information about all antennas in the array. Its columns depend on what information is available when the notebook is run (i.e. whether auto_metrics, ant_metrics, and/or redcal is done). These can be divided into 5 sections:

Basic Antenna Info: antenna number, node, and its a priori status.

Flag Fractions: Fraction of the night that an antenna was flagged for various reasons. Note that auto_metrics flags antennas for the whole night, so it'll be 0% or 100%.

auto_metrics Details: If auto_metrics is included, this section shows the modified Z-score signifying how much of an outlier each antenna and polarization is in each of four categories: bandpass shape, overall power, temporal variability, and temporal discontinuities. Bold red text indicates that this is a reason for flagging the antenna. It is reproduced from the auto_metrics_inspect.ipynb nightly notebook, so check that out for more details on the precise metrics.

ant_metrics Details: If ant_metrics is included, this section shows the average correlation-based metrics for antennas over the whole night. Low "dead ant" metrics (nominally below 0.4) indicate antennas not correlating with the rest of the array. Negative "crossed ant" metrics indicate antennas that show stronger correlations in their cross-pols than their same-pols, indicating that the two polarizations are probably swapped. Bold text indicates that the average is below the threshold for flagging.

redcal chi^2 Details: If redcal is included, this shows the median chi^2 per antenna. This would be 1 in an ideal array. Antennas are thrown out when they they are outliers in their median chi^2, usually greater than 4-sigma outliers in modified Z-score.

In [21]:
HTML(table.render())
Out[21]:
Ant Node A Priori Status Auto Metrics Flags Dead Fraction in Ant Metrics (Jee) Dead Fraction in Ant Metrics (Jnn) Crossed Fraction in Ant Metrics ee Shape Modified Z-Score nn Shape Modified Z-Score ee Power Modified Z-Score nn Power Modified Z-Score ee Temporal Variability Modified Z-Score nn Temporal Variability Modified Z-Score ee Temporal Discontinuties Modified Z-Score nn Temporal Discontinuties Modified Z-Score Average Dead Ant Metric (Jee) Average Dead Ant Metric (Jnn) Average Crossed Ant Metric
3 N01 digital_ok 0.00% 100.00% 100.00% 0.00% -0.081503 0.129111 -0.472796 -0.053719 -1.216633 -0.103471 0.592269 1.150497 0.028021 0.026838 0.001661
4 N01 RF_maintenance 0.00% 100.00% 100.00% 0.00% -0.581760 -0.630964 0.965267 1.023119 -0.493119 -0.402058 1.975209 0.498723 0.040266 0.035494 0.001874
5 N01 digital_ok 0.00% 100.00% 100.00% 0.00% -0.365210 0.708778 0.771360 -0.940992 -0.352207 -0.597905 0.191367 -1.142859 0.047625 0.041685 0.002845
7 N02 digital_ok 100.00% 100.00% 100.00% 0.00% 0.788325 0.813348 -0.880162 -0.810022 13.818419 15.439660 30.757427 36.563631 0.085548 0.064530 0.007961
8 N02 RF_maintenance 100.00% 0.00% 93.57% 0.00% 15.432168 16.117749 50.883376 52.409548 111.003921 90.995087 7.615079 -3.163348 0.724025 0.330709 0.586532
9 N02 digital_ok 0.00% 100.00% 100.00% 0.00% -0.692766 -0.290634 0.169335 -0.309199 0.936498 -0.280491 0.458881 0.004112 0.079142 0.064799 0.005758
10 N02 digital_ok 100.00% 100.00% 100.00% 0.00% 3.744096 3.508064 -0.022051 0.895690 9.732769 14.755481 37.434030 38.311506 0.029287 0.031435 0.000874
15 N01 digital_ok 0.00% 100.00% 100.00% 0.00% -1.024928 -0.675076 -0.919298 -0.800567 -0.399669 -1.325795 -0.721130 0.202223 0.029426 0.029092 0.000843
16 N01 digital_ok 0.00% 100.00% 100.00% 0.00% -0.917632 -0.754900 0.103326 -0.133086 -0.695494 0.873074 0.540650 -0.317196 0.029474 0.031424 0.002131
17 N01 digital_ok 0.00% 100.00% 100.00% 0.00% -0.180924 -0.244418 0.542621 0.730811 -0.779625 -0.306425 -0.156372 0.261698 0.029723 0.029484 0.000567
18 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 1.765722 5.856762 6.309320 14.331317 100.457165 24.639158 206.813840 21.133938 0.039343 0.037665 0.004093
19 N02 digital_ok 100.00% 100.00% 100.00% 0.00% 2.004020 1.179749 0.782664 0.472749 1.223895 4.594024 13.145043 3.487732 0.032183 0.036649 0.001815
20 N02 digital_ok 100.00% 100.00% 100.00% 0.00% 3.284668 -0.522185 4.346611 -1.119529 2.025451 -0.798647 3.969693 -0.441269 0.031511 0.034731 0.003045
21 N02 digital_ok 100.00% 100.00% 100.00% 0.00% -1.048369 -0.184082 0.238418 1.087234 -0.728783 0.771126 1.922661 5.122508 0.029321 0.033327 0.002854
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 5.771018 5.942544 3.321429 3.222468 4.853202 3.662200 12.015070 8.876617 0.037485 0.039719 0.002009
28 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 0.841764 11.245590 0.262695 18.340164 0.316318 12.123955 1.202394 11.641879 0.034384 0.042621 0.002155
29 N01 digital_ok 0.00% 100.00% 100.00% 0.00% -0.302187 -0.530946 -1.092007 -0.726958 -0.087718 0.056241 -0.496492 -0.004112 0.033709 0.033521 0.002251
30 N01 digital_ok 100.00% 100.00% 100.00% 0.00% 1.343575 2.136819 -0.704933 -0.160039 13.550888 16.573601 55.601854 48.673665 0.032085 0.036526 0.003057
31 N02 digital_ok 100.00% 100.00% 100.00% 0.00% 11.611834 -0.491319 8.426509 -1.144047 2.622875 6.593590 8.507591 3.502510 0.025631 0.031178 0.001332
32 N02 RF_maintenance 0.00% 100.00% 100.00% 0.00% 3.553846 2.416578 -0.293589 -0.592364 2.233617 -0.004896 -0.356334 0.814263 0.028678 0.029744 0.000569
33 N02 RF_maintenance 100.00% 100.00% 100.00% 0.00% -0.259240 6.160997 0.652759 6.016596 -0.952992 21.918035 1.091957 19.120911 0.055567 0.042100 0.002956
36 N03 RF_maintenance 100.00% 100.00% 100.00% 0.00% 8.119930 6.030624 6.152312 4.605768 3.326741 3.833003 5.690417 6.889872 0.023667 0.023492 0.000721
37 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 7.950815 6.740684 4.635766 3.621781 2.091574 3.420366 6.484596 26.636970 0.024605 0.024139 0.001031
38 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 9.094934 7.150544 7.289582 5.910833 4.202800 9.193622 17.801801 13.509176 0.023492 0.024507 0.000974
40 N04 digital_ok 100.00% 0.00% 2.92% 0.00% 17.806913 19.141789 28.160871 29.070274 311.632424 279.009283 42.707159 37.630155 0.737204 0.426194 0.543027
41 N04 digital_ok 0.00% 100.00% 100.00% 0.00% -0.845205 0.922878 -0.673138 -0.254995 0.479358 -0.175250 -0.578757 -0.088800 0.036976 0.032750 0.000267
42 N04 digital_ok 0.00% 100.00% 100.00% 0.00% 1.657557 0.823885 -0.361601 0.712162 1.392609 -0.024759 -0.397511 0.773309 0.037920 0.065312 0.005619
45 N05 digital_ok 100.00% 100.00% 100.00% 0.00% -0.994642 -0.248381 -0.951538 -0.767186 0.993096 4.795321 1.187291 21.526086 0.026963 0.029499 0.001727
46 N05 digital_ok 0.00% 100.00% 100.00% 0.00% 2.814239 1.002133 1.193880 0.521403 3.872214 2.125633 1.535357 1.933363 0.026080 0.028347 0.002982
50 N03 RF_maintenance 100.00% 100.00% 100.00% 0.00% 10.155192 8.333510 5.617041 3.175046 1.656033 -0.026633 4.932873 1.708640 0.023435 0.023465 0.000322
51 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 9.650057 8.653448 4.191132 3.878386 8.487733 6.679263 16.121548 16.089101 0.025210 0.024094 0.000702
52 N03 RF_maintenance 100.00% 100.00% 100.00% 0.00% 6.236887 4.518939 8.272565 6.938327 3.613295 0.007756 14.062350 8.401923 0.024635 0.023656 0.000993
53 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 7.088712 4.971651 6.546878 6.826530 82.001078 93.006991 79.623504 97.128339 0.027363 0.024700 0.001075
54 N04 digital_ok 0.00% 100.00% 100.00% 0.00% 0.845383 -0.789290 0.815562 0.569532 -0.544486 0.352991 0.432844 1.390399 0.043071 0.092763 0.005281
55 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 1.023511 1.421945 -0.605571 -0.740376 10.907655 -0.604741 1.109594 0.684455 0.036582 0.057462 0.001183
56 N04 digital_ok 0.00% 100.00% 100.00% 0.00% -1.035755 -0.550249 0.044782 0.358350 -0.147009 2.649124 0.284777 0.140662 0.034513 0.051667 0.005139
57 N04 RF_maintenance 0.00% 100.00% 100.00% 0.00% 2.326651 -0.751501 -0.053379 -1.153095 1.176306 3.827846 2.232919 0.207740 0.039592 0.035390 0.005187
65 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 7.268483 4.951129 8.100656 6.032004 0.598366 3.499289 9.049926 9.902152 0.024056 0.024697 0.001396
66 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 6.500193 4.264227 1.238807 0.574219 52.208257 45.172192 127.426395 125.682570 0.024270 0.024292 0.000548
67 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 8.931536 7.598723 6.146382 5.671339 2.730992 5.968670 7.320433 13.809848 0.023491 0.024480 0.000534
68 N03 digital_ok 100.00% 100.00% 100.00% 0.00% 8.847365 8.957556 7.801666 7.042747 1.547263 2.835400 8.723880 10.046868 0.024984 0.024610 0.001056
69 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 0.278643 -0.048724 -0.984305 0.222670 3.732599 10.778008 0.776491 1.860149 0.034870 0.043530 0.001302
70 N04 RF_maintenance 100.00% 0.00% 0.00% 0.00% 22.436812 19.046372 32.547052 29.594530 330.441792 316.639465 31.124191 41.956436 0.750061 0.454818 0.523460
71 N04 digital_ok 0.00% 100.00% 100.00% 0.00% -0.636223 1.362387 -0.959252 -0.705614 2.061421 0.283406 -0.041900 -0.843769 0.041306 0.052671 0.011412
72 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 15.907395 19.204526 28.828414 32.516680 313.831405 287.818811 43.249272 30.952028 0.743136 0.460755 0.517306
73 N05 digital_ok 100.00% 100.00% 100.00% 0.00% 6.466209 0.137042 2.635838 0.333032 7.186896 11.768199 3.609207 2.358771 0.025638 0.027477 0.003611
81 N07 digital_ok 0.00% 100.00% 100.00% 0.00% 0.274618 0.286080 1.922096 2.669461 -1.210182 0.377429 -1.210836 0.442227 0.058515 0.070757 0.008181
82 N07 RF_maintenance 0.00% 100.00% 100.00% 0.00% 0.827617 2.109134 2.276604 0.781503 -0.882129 -1.087321 0.683629 2.788298 0.066711 0.046917 0.002880
83 N07 digital_ok 0.00% 100.00% 100.00% 0.00% -0.574479 0.559474 2.209368 3.098151 -0.088507 1.496214 -0.824716 -1.267363 0.043303 0.064935 0.009201
84 N08 digital_ok 100.00% 100.00% 100.00% 0.00% 3.805989 3.473621 4.077631 3.092627 2.656595 1.367186 6.495203 9.032488 0.027275 0.025721 0.000940
85 N08 digital_ok 0.00% 100.00% 100.00% 0.00% 0.993755 1.490117 2.281758 2.453097 0.842391 -0.321412 -1.368273 -0.657719 0.029165 0.027468 0.001286
86 N08 digital_ok 100.00% 100.00% 100.00% 0.00% 0.463494 -0.799679 2.839729 2.601577 14.886971 6.751649 12.810836 11.299717 0.033529 0.028071 0.001120
87 N08 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
88 N09 digital_ok 100.00% 100.00% 100.00% 0.00% 17.356603 15.157546 32.084804 21.499830 108.408584 112.221528 426.540711 434.442044 0.037388 0.034313 0.002305
90 N09 RF_maintenance 0.00% 100.00% 100.00% 0.00% 1.288947 2.107292 0.896034 1.030365 -0.863238 -0.428975 -0.687076 -0.908852 0.038066 0.038526 0.001923
91 N09 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
92 N10 RF_maintenance 100.00% 100.00% 100.00% 0.00% 0.132514 -0.216033 -1.061161 -1.013331 2.107322 4.979949 1.112496 4.334563 0.030314 0.032308 0.002727
93 N10 digital_ok 0.00% 100.00% 100.00% 0.00% -0.716397 1.562774 -0.214599 -0.648501 3.855061 1.715639 1.712522 -0.013175 0.029986 0.032419 0.002201
94 N10 digital_ok 100.00% 100.00% 100.00% 0.00% -1.034425 -1.079333 1.016286 -0.216529 0.458243 31.707681 2.491097 10.604562 0.028232 0.031175 0.001646
98 N07 digital_ok 0.00% 100.00% 100.00% 0.00% 2.051190 1.714467 1.782563 1.871039 0.618159 -0.236177 0.362158 -0.263942 0.076629 0.069774 0.010631
99 N07 digital_ok 100.00% 0.00% 0.00% 0.00% 21.555631 19.059396 32.535999 31.734024 319.809289 305.640723 34.461406 35.848674 0.809792 0.508390 0.583031
100 N07 digital_ok 100.00% 0.00% 0.00% 0.00% 17.462259 18.888878 29.591187 28.158349 311.632124 270.853337 39.465237 43.449875 0.808541 0.519066 0.578685
101 N08 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
102 N08 RF_maintenance 100.00% 100.00% 100.00% 0.00% 9.918974 10.560791 16.785734 17.639875 12507.773553 12947.630869 28769.398329 28593.962102 0.030895 0.027571 0.001386
103 N08 digital_ok 100.00% 100.00% 100.00% 0.00% 3.589709 2.743183 4.818551 4.309626 1.677571 0.429039 11.192982 6.291479 0.023644 0.023393 0.000304
104 N08 RF_maintenance 100.00% 100.00% 100.00% 0.00% 3.337135 54.824443 4.020808 35.147122 -0.397819 13.151922 3.865367 30.895797 0.025280 0.020557 0.005265
105 N09 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
106 N09 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
107 N09 digital_ok 100.00% 100.00% 100.00% 0.00% 2.370674 -0.701613 5.570470 4.454370 3.796745 1.738993 4.230180 5.343326 0.030058 0.028222 0.000831
108 N09 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
109 N10 digital_ok 0.00% 100.00% 100.00% 0.00% 0.796426 -0.399366 -0.563130 -0.516481 0.362877 0.554625 -0.028196 -0.667642 0.032927 0.033700 0.000929
110 N10 RF_maintenance 100.00% 100.00% 100.00% 0.00% 11.943352 9.676677 3.200277 4.411755 4.905898 2.718524 2.711587 3.646901 0.024458 0.027435 0.001817
111 N10 digital_ok 100.00% 100.00% 100.00% 0.00% 0.268016 -0.153792 0.688059 -0.142716 1.400233 5.952884 0.287833 0.302519 0.028268 0.028945 0.000396
112 N10 digital_ok 0.00% 100.00% 100.00% 0.00% 0.607072 -0.404683 -0.002638 0.165977 1.998231 0.732597 -0.765154 -0.382334 0.028904 0.034634 0.001582
116 N07 digital_ok 0.00% 100.00% 100.00% 0.00% 1.530475 1.957292 0.477902 0.400817 0.254659 -0.429192 -0.194055 -1.085875 0.064778 0.081483 0.004881
117 N07 digital_ok 0.00% 100.00% 100.00% 0.00% 0.796120 0.712300 3.258206 3.211283 2.213129 0.004896 -0.358469 -1.751848 0.077292 0.083013 0.001500
118 N07 digital_ok 100.00% 100.00% 100.00% 0.00% -0.694237 4.733696 2.104733 -0.162163 0.073586 -0.467681 -0.575265 -0.905029 0.066132 0.084250 0.016171
119 N07 RF_maintenance 100.00% 100.00% 100.00% 0.00% 1.835227 -0.523838 5.663305 2.948834 3.726402 6.367987 0.005119 -1.157617 0.047005 0.041632 0.000406
120 N08 RF_maintenance 100.00% 100.00% 100.00% 0.00% 5.145651 1.289671 0.269826 7.787020 154.072428 3.080181 350.217007 22.284537 0.027377 0.023231 0.003299
121 N08 digital_ok 100.00% 100.00% 100.00% 0.00% 8.710920 4.054410 5.326953 6.541161 34.066500 31.504947 136.343733 102.318200 0.025827 0.025056 0.000519
122 N08 digital_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
123 N08 digital_ok 100.00% 100.00% 100.00% 0.00% 4.110823 2.460317 3.811353 4.120026 -0.431673 0.217181 4.432019 6.811046 0.027216 0.025761 0.000866
125 N09 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
126 N09 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
127 N10 digital_ok 0.00% 100.00% 100.00% 0.00% 0.475218 0.172193 0.682869 0.324134 -0.565526 1.397006 -0.224968 0.362476 0.037002 0.036460 0.001237
128 N10 digital_ok 0.00% 100.00% 100.00% 0.00% -0.435296 -0.464674 0.630562 -0.193233 -0.184150 0.533108 -0.024382 -0.177940 0.040758 0.038833 0.001798
129 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 17.436155 19.462085 30.658410 31.649909 338.034227 298.799471 37.391618 34.675425 0.749397 0.465779 0.518790
130 N10 digital_ok 0.00% 100.00% 100.00% 0.00% -0.992755 -0.861460 -0.016935 0.021875 -0.255349 2.527458 -0.023877 1.252900 0.029293 0.037217 0.001249
135 N12 digital_maintenance 0.00% 100.00% 100.00% 0.00% -0.671448 -1.045131 0.512969 0.675843 0.653487 2.413572 2.033700 0.177135 0.032420 0.031811 0.001784
136 N12 digital_maintenance 0.00% 100.00% 100.00% 0.00% -0.433950 0.001426 -1.114781 -1.145335 0.553218 0.090258 0.628404 -0.451813 0.033985 0.030768 0.000257
137 N07 RF_maintenance 100.00% 0.00% 0.00% 0.00% 16.746938 19.295406 43.675101 37.296141 203.014815 288.211100 13.629661 24.770367 0.812891 0.482661 0.595606
138 N07 RF_maintenance 0.00% 100.00% 100.00% 0.00% -0.673905 1.281688 -0.833620 -0.462792 -0.800794 -0.796616 2.231326 -1.340636 0.028250 0.027401 0.000665
140 N13 digital_ok 100.00% 100.00% 100.00% 0.00% 6.526198 6.431720 2.436515 3.242122 2.162736 3.000142 1.718881 2.757386 0.033361 0.028071 0.001260
141 N13 digital_ok 100.00% 100.00% 100.00% 0.00% 1.491410 2.497130 1.681315 2.308096 -0.071514 3.722491 1.519298 12.723796 0.043775 0.037975 0.002117
142 N13 digital_ok 100.00% 100.00% 100.00% 0.00% 3.384124 4.613968 0.002964 3.518470 12.619948 3.217124 4.835138 7.166019 0.054194 0.045367 0.000609
143 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 18.142989 19.128813 25.466486 30.655857 337.534161 294.871847 52.893010 38.391197 0.804558 0.500330 0.611820
144 N14 digital_ok 100.00% 100.00% 100.00% 0.00% -0.949849 -0.543999 -0.460647 -0.304310 4.095914 2.515313 1.229755 5.220051 0.031287 0.029479 0.001207
145 N14 RF_maintenance 100.00% 100.00% 100.00% 0.00% 5.281541 5.548642 3.569437 3.883585 3.470413 3.949889 8.665463 15.031987 0.030413 0.027994 0.001335
150 N15 RF_maintenance 100.00% 100.00% 100.00% 0.00% 4.707167 4.744610 3.531293 4.634944 3.094991 5.843910 10.621538 13.747152 0.123096 0.122767 0.010523
155 N12 digital_maintenance 100.00% 100.00% 100.00% 0.00% 6.450882 8.011372 2.531650 3.137503 7.940449 31.133277 10.166454 16.024681 0.035331 0.027347 0.001006
156 N12 digital_ok 0.00% 100.00% 100.00% 0.00% 0.207495 -0.028834 -0.990879 -0.580268 -0.775648 -0.874744 -0.506989 1.919162 0.030889 0.029522 0.001478
157 N12 digital_ok 0.00% 100.00% 100.00% 0.00% 0.144137 -0.001426 -0.167548 -0.860262 0.190911 1.976848 0.094599 -1.420719 0.035311 0.032237 0.003312
158 N12 digital_ok 100.00% 100.00% 100.00% 0.00% 6.258856 0.000174 3.425840 1.785169 2.405573 4.182493 2.563861 2.845499 0.029448 0.030776 0.001980
160 N13 digital_ok 100.00% 100.00% 100.00% 0.00% 5.959607 6.565891 3.125381 3.324654 3.567818 6.173137 9.109719 12.779395 0.044834 0.051001 0.010730
161 N13 digital_ok 100.00% 100.00% 100.00% 0.00% 0.476245 3.984046 -0.288190 0.465219 1.956292 1.797578 1.308168 1.814849 0.053622 0.038988 0.005253
162 N13 digital_ok 0.00% 100.00% 100.00% 0.00% -0.397089 -0.278465 -0.523746 0.002638 1.028055 -0.590874 -0.119752 0.505526 0.070674 0.036665 0.018631
163 N14 digital_ok 100.00% 100.00% 100.00% 0.00% -0.094689 -0.522170 0.114123 -0.115170 3.700766 3.507707 6.465173 8.586355 0.033089 0.037890 0.004605
164 N14 digital_ok 0.00% 100.00% 100.00% 0.00% 0.037827 -0.058319 -0.518248 0.179399 1.879935 2.068204 1.449844 1.257953 0.030955 0.036091 0.005363
165 N14 digital_ok 0.00% 100.00% 100.00% 0.00% 3.654669 -0.399598 1.172890 -1.149395 0.812523 -0.421800 -1.292544 1.000280 0.029314 0.027525 0.001253
166 N14 RF_maintenance 0.00% 100.00% 100.00% 0.00% -0.595516 0.188572 -0.582563 -0.847443 1.142807 -0.796049 -0.598421 -0.933547 0.030391 0.028968 0.000440
167 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 7.792489 8.811748 49.891188 52.592197 110.135065 94.684408 5.399992 33.890966 0.689479 0.483349 0.383613
168 N15 RF_maintenance 100.00% 0.00% 0.00% 0.00% 15.651554 16.148823 50.862067 54.795414 113.549025 56.822807 -1.014109 -8.554260 0.821982 0.587950 0.498894
169 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 15.164483 15.775072 53.428817 53.432235 73.270188 69.319943 -3.817450 -6.354631 0.821799 0.568150 0.505710
170 N15 digital_ok 100.00% 0.00% 0.00% 0.00% 14.791556 15.567211 53.641775 52.229483 70.206269 94.479965 -3.396488 -4.803085 0.804854 0.555449 0.515703
176 N12 digital_ok 0.00% 100.00% 100.00% 0.00% -0.706788 0.672461 -0.595514 -0.730533 -1.288177 -1.786156 -0.681339 -1.473423 0.034967 0.031851 0.002168
177 N12 digital_ok 0.00% 100.00% 100.00% 0.00% -0.410551 1.137904 -0.472449 0.335140 0.228777 1.684615 -0.207719 0.967992 0.038207 0.031606 0.002216
178 N12 digital_ok 100.00% 100.00% 100.00% 0.00% 2.567259 2.719744 0.680386 1.557817 63.811014 71.467955 87.772711 100.207366 0.034230 0.032128 0.001714
179 N12 digital_ok 100.00% 100.00% 100.00% 0.00% -0.483481 0.244014 0.443627 1.327881 12.148813 -0.389710 2.067507 1.449405 0.036734 0.032755 0.001868
180 N13 RF_maintenance 100.00% 100.00% 100.00% 0.00% -0.989673 5.164622 0.473588 3.903395 1.357113 2.131046 0.495337 10.441877 0.046802 0.043638 0.001628
181 N13 digital_ok 100.00% 100.00% 100.00% 0.00% 5.194868 10.770059 3.753900 5.140727 3.402081 22.385484 8.935116 53.419160 0.057603 0.048580 0.005107
182 N13 RF_maintenance 100.00% 0.00% 38.01% 0.00% 15.780982 16.255146 51.038025 7.294666 113.751834 256.239672 -0.754341 146.009039 0.803480 0.408634 0.624839
183 N13 digital_ok 0.00% 100.00% 100.00% 0.00% -0.590195 0.316676 -0.227127 -0.782934 -1.078028 1.098381 -0.798418 1.961924 0.046709 0.037090 0.003324
184 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 1.211034 0.622250 -0.438841 -0.258315 16.100960 14.736795 42.717252 44.470719 0.027506 0.029139 0.000420
185 N14 digital_ok 100.00% 100.00% 100.00% 0.00% 0.054299 -0.868819 -0.978100 -0.218658 63.798188 50.498225 228.738524 183.232228 0.030086 0.028620 0.000931
186 N14 digital_ok 0.00% 100.00% 100.00% 0.00% 1.627551 1.630589 0.708066 0.489627 -0.045248 -0.252242 2.494927 3.339605 0.030115 0.028560 0.000889
187 N14 digital_ok 0.00% 100.00% 100.00% 0.00% -0.767552 -0.196230 -0.532523 -0.875659 -0.306834 -0.204300 2.233261 0.858503 0.026889 0.028878 0.001524
189 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 1.917186 1.490770 -0.447635 0.628087 17.605622 -1.099215 72.383571 1.630558 0.031190 0.042992 0.003892
190 N15 digital_ok 100.00% 100.00% 100.00% 0.00% 5.097383 4.722270 0.353091 3.893050 1.945874 2.910092 -0.179285 12.200689 0.033315 0.053095 0.003364
191 N15 digital_ok 0.00% 100.00% 100.00% 0.00% -0.201723 0.509537 1.202853 1.455827 0.324050 -1.341733 1.669522 2.157081 0.035179 0.057532 0.003258
203 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
220 N18 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
221 N18 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
222 N18 RF_ok 100.00% 100.00% 100.00% 0.00% nan nan inf inf nan nan nan nan nan nan nan
320 N03 dish_maintenance 100.00% 100.00% 100.00% 0.00% 3.409127 5.307676 5.192991 5.769949 6.321976 4.961668 20.080945 10.883175 0.028858 0.026831 0.001107
321 N02 not_connected 100.00% 0.00% 100.00% 0.00% 16.569026 17.815756 43.472183 43.023153 216.321591 207.816508 33.635083 39.869823 0.698371 0.305386 0.581733
323 N02 not_connected 100.00% 100.00% 100.00% 0.00% 0.514555 3.850564 14.949441 19.888753 3.528696 10.069591 4.061229 6.982913 0.052561 0.041395 0.003724
324 N04 not_connected 100.00% 100.00% 100.00% 0.00% 6.949643 -0.507037 20.654802 17.175651 2.942664 -0.236912 -0.353768 1.464084 0.041462 0.033972 0.001876
329 N12 dish_maintenance 100.00% 100.00% 100.00% 0.00% 3.241251 0.770180 14.385211 16.290062 -0.280463 0.857737 0.007727 6.066386 0.030661 0.029408 0.000924
333 N12 dish_maintenance 100.00% 100.00% 100.00% 0.00% 3.184579 -0.068105 14.319428 14.984264 1.506532 5.043417 3.472562 3.462329 0.036296 0.030911 0.000930
In [22]:
# print ex_ants for easy copy-pasting to YAML file
proposed_ex_ants = [ant for i, ant in enumerate(ants) if np.any([col[i] > 0 for col in bar_cols.values()])]
print('ex_ants: [' + ", ".join(str(ant) for ant in proposed_ex_ants) + ']')
print(f'\nunflagged_ants: [{", ".join([str(ant) for ant in ants if ant not in proposed_ex_ants])}]')
# "golden" means no flags and good a priori status
golden_ants = ", ".join([str(ant) for ant in ants if ((ant not in proposed_ex_ants) and (a_priori_statuses[ant] in good_statuses.split(',')))])
print(f'\ngolden_ants: [{golden_ants}]')
ex_ants: [3, 4, 5, 7, 8, 9, 10, 15, 16, 17, 18, 19, 20, 21, 27, 28, 29, 30, 31, 32, 33, 36, 37, 38, 40, 41, 42, 45, 46, 50, 51, 52, 53, 54, 55, 56, 57, 65, 66, 67, 68, 69, 70, 71, 72, 73, 81, 82, 83, 84, 85, 86, 87, 88, 90, 91, 92, 93, 94, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 116, 117, 118, 119, 120, 121, 122, 123, 125, 126, 127, 128, 129, 130, 135, 136, 137, 138, 140, 141, 142, 143, 144, 145, 150, 155, 156, 157, 158, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 189, 190, 191, 203, 220, 221, 222, 320, 321, 323, 324, 329, 333]

unflagged_ants: []

golden_ants: []
In [23]:
# write to csv
outpath = os.path.join(nb_outdir, f'rtp_summary_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/rtp_summary_table_2459833.csv
In [24]:
# Load antenna positions
data_list = sorted(glob.glob(os.path.join(data_path, f'zen.{JD}.?????.sum.uvh5')))
hd = io.HERAData(data_list[len(data_list) // 2])

# Figure out where to draw the nodes
node_centers = {}
for node in sorted(set(list(nodes.values()))):
    if np.isfinite(node):
        this_node_ants = [ant for ant in ants + unused_ants if nodes[ant] == node]
        if len(this_node_ants) == 1:
            # put the node label just to the west of the lone antenna 
            node_centers[node] = hd.antpos[ant][node] + np.array([-14.6 / 2, 0, 0])
        else:
            # put the node label between the two antennas closest to the node center
            node_centers[node] = np.mean([hd.antpos[ant] for ant in this_node_ants], axis=0)
            closest_two_pos = sorted([hd.antpos[ant] for ant in this_node_ants], 
                                     key=lambda pos: np.linalg.norm(pos - node_centers[node]))[0:2]
            node_centers[node] = np.mean(closest_two_pos, axis=0)
In [25]:
def Plot_Array(ants, unused_ants, outriggers):
    plt.figure(figsize=(16,16))
    
    plt.scatter(np.array([hd.antpos[ant][0] for ant in hd.data_ants if ant in ants]), 
                np.array([hd.antpos[ant][1] for ant in hd.data_ants if ant in ants]), c='w', s=0)

    # connect every antenna to their node
    for ant in ants:
        if nodes[ant] in node_centers:
            plt.plot([hd.antpos[ant][0], node_centers[nodes[ant]][0]], 
                     [hd.antpos[ant][1], node_centers[nodes[ant]][1]], 'k', zorder=0)

    rc_color = '#0000ff'
    antm_color = '#ffa500'
    autom_color = '#ff1493'

    # Plot 
    unflagged_ants = []
    for i, ant in enumerate(ants):
        ant_has_flag = False
        # plot large blue annuli for redcal flags
        if use_redcal:
            if redcal_flagged_frac[ant] > 0:
                ant_has_flag = True
                plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=7 * (2 - 1 * float(not outriggers)), fill=True, lw=0,
                                                color=rc_color, alpha=redcal_flagged_frac[ant]))
                plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=6 * (2 - 1 * float(not outriggers)), fill=True, color='w'))
        
        # plot medium green annuli for ant_metrics flags
        if use_ant_metrics: 
            if ant_metrics_xants_frac_by_ant[ant] > 0:
                ant_has_flag = True
                plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=6 * (2 - 1 * float(not outriggers)), fill=True, lw=0,
                                                color=antm_color, alpha=ant_metrics_xants_frac_by_ant[ant]))
                plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=5 * (2 - 1 * float(not outriggers)), fill=True, color='w'))
        
        # plot small red annuli for auto_metrics
        if use_auto_metrics:
            if ant in auto_ex_ants:
                ant_has_flag = True                
                plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=5 * (2 - 1 * float(not outriggers)), fill=True, lw=0, color=autom_color)) 
        
        # plot black/white circles with black outlines for antennas
        plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=4 * (2 - 1 * float(not outriggers)), fill=True, color=['w', 'k'][ant_has_flag], ec='k'))
        if not ant_has_flag:
            unflagged_ants.append(ant)

        # label antennas, using apriori statuses if available
        try:
            bgc = matplotlib.colors.to_rgb(status_colors[a_priori_statuses[ant]])
            c = 'black' if (bgc[0]*0.299 + bgc[1]*0.587 + bgc[2]*0.114) > 186 / 256 else 'white'
        except:
            c = 'k'
            bgc='white'
        plt.text(hd.antpos[ant][0], hd.antpos[ant][1], str(ant), va='center', ha='center', color=c, backgroundcolor=bgc)

    # label nodes
    for node in sorted(set(list(nodes.values()))):
        if not np.isnan(node) and not np.all(np.isnan(node_centers[node])):
            plt.text(node_centers[node][0], node_centers[node][1], str(node), va='center', ha='center', bbox={'color': 'w', 'ec': 'k'})
    
    # build legend 
    legend_objs = []
    legend_labels = []
    
    # use circles for annuli 
    legend_objs.append(matplotlib.lines.Line2D([0], [0], marker='o', color='w', markeredgecolor='k', markerfacecolor='w', markersize=13))
    legend_labels.append(f'{len(unflagged_ants)} / {len(ants)} Total {["Core", "Outrigger"][outriggers]} Antennas Never Flagged')
    legend_objs.append(matplotlib.lines.Line2D([0], [0], marker='o', color='w', markerfacecolor='k', markersize=15))
    legend_labels.append(f'{len(ants) - len(unflagged_ants)} Antennas {["Core", "Outrigger"][outriggers]} Flagged for Any Reason')

    if use_auto_metrics:
        legend_objs.append(matplotlib.lines.Line2D([0], [0], marker='o', color='w', markeredgewidth=2, markeredgecolor=autom_color, markersize=15))
        legend_labels.append(f'{len([ant for ant in auto_ex_ants if ant in ants])} {["Core", "Outrigger"][outriggers]} Antennas Flagged by Auto Metrics')
    if use_ant_metrics: 
        legend_objs.append(matplotlib.lines.Line2D([0], [0], marker='o', color='w', markeredgewidth=2, markeredgecolor=antm_color, markersize=15))
        legend_labels.append(f'{np.round(np.sum([frac for ant, frac in ant_metrics_xants_frac_by_ant.items() if ant in ants]), 2)} Antenna-Nights on' 
                             f'\n{np.sum([frac > 0 for ant, frac in ant_metrics_xants_frac_by_ant.items() if ant in ants])} {["Core", "Outrigger"][outriggers]} Antennas '
                             'Flagged by Ant Metrics\n(alpha indicates fraction of time)')        
    if use_redcal:
        legend_objs.append(matplotlib.lines.Line2D([0], [0], marker='o', color='w', markeredgewidth=2, markeredgecolor=rc_color, markersize=15))
        legend_labels.append(f'{np.round(np.sum(list(redcal_flagged_frac.values())), 2)} Antenna-Nights on' 
                             f'\n{np.sum([frac > 0 for ant, frac in redcal_flagged_frac.items() if ant in ants])} {["Core", "Outrigger"][outriggers]} Antennas '
                             'Flagged by Redcal\n(alpha indicates fraction of time)')

    # use rectangular patches for a priori statuses that appear in the array
    for aps in sorted(list(set(list(a_priori_statuses.values())))):
        if aps != 'Not Found':
            legend_objs.append(plt.Circle((0, 0), radius=7, fill=True, color=status_colors[aps]))
            legend_labels.append(f'A Priori Status:\n{aps} ({[status for ant, status in a_priori_statuses.items() if ant in ants].count(aps)} {["Core", "Outrigger"][outriggers]} Antennas)')

    # label nodes as a white box with black outline
    if len(node_centers) > 0:
        legend_objs.append(matplotlib.patches.Patch(facecolor='w', edgecolor='k'))
        legend_labels.append('Node Number')

    if len(unused_ants) > 0:
        legend_objs.append(matplotlib.lines.Line2D([0], [0], marker='o', color='w', markerfacecolor='grey', markersize=15, alpha=.2))
        legend_labels.append(f'Anntenna Not In Data')
        
    
    plt.legend(legend_objs, legend_labels, ncol=2, fontsize='large', framealpha=1)
    
    if outriggers:
        pass
    else:
        plt.xlim([-200, 150])
        plt.ylim([-150, 150])        
       
    # set axis equal and label everything
    plt.axis('equal')
    plt.tight_layout()
    plt.title(f'Summary of {["Core", "Outrigger"][outriggers]} Antenna Statuses and Metrics on {JD}', size=20)    
    plt.xlabel("Antenna East-West Position (meters)", size=12)
    plt.ylabel("Antenna North-South Position (meters)", size=12)
    plt.xticks(fontsize=12)
    plt.yticks(fontsize=12)
    xlim = plt.gca().get_xlim()
    ylim = plt.gca().get_ylim()    
        
    # plot unused antennas
    plt.autoscale(False)    
    for ant in unused_ants:
        if nodes[ant] in node_centers:
            plt.plot([hd.antpos[ant][0], node_centers[nodes[ant]][0]], 
                     [hd.antpos[ant][1], node_centers[nodes[ant]][1]], 'k', alpha=.2, zorder=0)
        
        plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=4, fill=True, color='w', ec=None, alpha=1, zorder=0))
        plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=4, fill=True, color='grey', ec=None, alpha=.2, zorder=0))
        if hd.antpos[ant][0] < xlim[1] and hd.antpos[ant][0] > xlim[0]:
            if hd.antpos[ant][1] < ylim[1] and hd.antpos[ant][1] > ylim[0]:
                plt.text(hd.antpos[ant][0], hd.antpos[ant][1], str(ant), va='center', ha='center', color='k', alpha=.2) 

Figure 1: Array Plot of Flags and A Priori Statuses¶

This plot shows all antennas, which nodes they are connected to, and their a priori statuses (as the highlight text of their antenna numbers). It may also show (depending on what is finished running):

  • Whether they were flagged by auto_metrics (red circle) for bandpass shape, overall power, temporal variability, or temporal discontinuities. This is done in a binary fashion for the whole night.
  • Whether they were flagged by ant_metrics (green circle) as either dead (on either polarization) or crossed, with the transparency indicating the fraction of the night (i.e. number of files) that were flagged.
  • Whether they were flagged by redcal (blue circle) for high chi^2, with the transparency indicating the fraction of the night (i.e. number of files) that were flagged.

Note that the last fraction does not include antennas that were flagged before going into redcal due to their a priori status, for example.

In [26]:
core_ants = [ant for ant in ants if ant < 320]
outrigger_ants = [ant for ant in ants if ant >= 320]
Plot_Array(ants=core_ants, unused_ants=unused_ants, outriggers=False)
if len(outrigger_ants) > 0:
    Plot_Array(ants=outrigger_ants, unused_ants=sorted(set(unused_ants + core_ants)), outriggers=True)

Metadata¶

In [27]:
from hera_qm import __version__
print(__version__)
from hera_cal import __version__
print(__version__)
2.0.3.dev47+ga570afb
3.1.4.dev14+g122e1cb
In [ ]: